
#include <iostream>
#include <string>
using namespace std;


#define MAX(a, b) ((a) > (b) ? (a) : (b))

int max(int a, int b);
int max(float a, float b);

class Person
{
public:
    Person(const string &name = "shiyanlou");
    ~Person();
    void print();
protected:
    string name;
};

Person::Person(const string &name)
    : name(name)
{
    cout << "Person()" << endl;
}

Person::~Person()
{
    cout << "~Person()" << endl;
}

void Person::print()
{
    cout << "name: " << name << endl;
}


class Student : virtual public Person
{
public:
    Student(const string &name = "shiyanlou", int age = 15);
    ~Student();
protected:
    int age;
};

Student::Student(const string &name, int age)
    : age(age)
    , Person("Student: " + name)
{
    cout << "Student()" << endl;
}

Student::~Student()
{
    cout << "~Student()" << endl;
}

class Child : virtual public Person
{
public:
    Child(const string &name = "shiyanlou", const string &color = "blue");
    ~Child();
protected:
    string color;
};

Child::Child(const string &name, const string &color)
    : color(color)
    , Person("Child: " + name)
{
    cout << "Child()" << endl;
}

Child::~Child()
{
    cout << "~Child()" << endl;
}

class HighStudent : public Student, public Child
{
public:
    HighStudent(const string &name = "shiyanlou", int age = 15, const string &color = "blue", float h = 1.75);
    ~HighStudent();
protected:
    float height;
};

HighStudent::HighStudent(const string &name, int age, const string &color, float h)
    : Student(name, age)
    , Child(name, color)
    , height(h)
{
    cout << "HighStudent()" << endl;
}

HighStudent::~HighStudent()
{
    cout << "~HighStudent()" << endl;
}

int main()
{
    HighStudent stu("jake", 15);
    stu.Student::print();
    stu.Child::print();

    cout << MAX(1 + 2, 2) << endl;
    ((1 + 2) > (2) ? (1 + 2) : (2));

    return 0;
}